﻿<UserControl x:Class="Tanmia.Warehouse.Presentation.Scenarios.SectionTreeBrowser"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:loc="clr-namespace:Tanmia.Warehouse.Presentation"
             xmlns:regions="http://www.codeplex.com/prism">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="25" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <ToolBar Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
            <Button Content="تحديث" Command="{Binding Path=RefreshCommand}" />
            <Button Content="إضافة" Command="{Binding Path=ShowSectionEditor}" CommandParameter="{Binding ElementName=tvStoreTree, Path=SelectedItem}" />
        </ToolBar>
        
        <TreeView Name="tvStoreTree" Style="{x:Null}" ItemsSource="{Binding Path=TreeItems, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />

        <ContentControl regions:RegionManager.RegionName="{x:Static loc:Constants.RegionSectionTree}" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
    </Grid>
</UserControl>
